<?php


function status_get_from_code($status_code)
{
	$status_code = mysql_real_escape_string($status_code);

	$sql = 'select id from MemberStatus where code = "'.$status_code.'";';
	$data = sql_query($sql);
	$row = mysql_fetch_row($data);
	$status_id = intval($row[0]);
	return $status_id;
}

function status_get_by_id($id)
{
	$id  = intval($id);
	$sql = 'select id, code, label, color
	        from MemberStatus
			where id = '.$id.';';
	$data = mysql_query($sql);
	$row = mysql_fetch_assoc($data);
	return $row;
}